package post_to_in_pkg.recoder;
import post_to_in_pkg.parser.Parser;
public class Recoder_v1 {
	Parser p;
	
	public Recoder_v1(Parser argp) {
		p=argp;
	}
	
	public Recoder_v1() {
		
	}
	public void setParser(Parser argp) {
		p=argp;
	}
	
	public StringBuffer writeInBuffer() {
		
		StringBuffer strBuf=new StringBuffer();
		if(p!=null) {
			p.getSyntaxTree().printChild(strBuf);
			int next=strBuf.indexOf("\n");
			while(next!=-1&&next+1<strBuf.length()) {
				if(strBuf.charAt(next+1)=='\n')
					strBuf.deleteCharAt(next+1);
				next=strBuf.indexOf("\n",next+1);
			}
		}
		return strBuf;
	}
	
	
}
